// include/characters/Player.hh
#ifndef PLAYER_HH
#define PLAYER_HH

#include "Character.hh"
#include <vector>
#include <string>
#include <array>

/**
 * @class Player
 * @brief Represents the main player-controlled character in the game.
 *
 * Contains player-specific attributes and behaviors such as movement,
 * attacking, and interacting with the game world.
 */

class Player : public Character
{
private:
    std::vector<Item *> inventory;
    static const size_t MAX_INVENTORY_CAPACITY = 10;

    bool flashlightOn = true;
    bool flashlightBroken = false;

public:
    bool success = false;

    std::array<int, 7> item_number = {0};

    Player(const std::string &name);

    ~Player() override;

    Player &operator++();

    bool attack(ICharacter &target) override;

    void addToInventory(Item *item) override;
    void displayInventory() const override;

    void useItem(size_t inventoryIndex);

    void applyItemPassiveEffect(const Item &item);
    void removeItemPassiveEffect(const Item &item);

    unsigned int getMaxdefensePower() const;
    // Flashlight status
    bool isFlashlightOn() const;
    void toggleFlashlight();
    bool isFlashlightBroken() const;
    void breakFlashlight();

    // Access inventory
    const std::vector<Item *> &getInventory() const;
    void combatLoop(Character *enemy);
};

#endif
